/* MACHINE-GENERATED ! */

frame pads {
	set x = (ix-0.5)*(gx+px)

	set y = (iy-(n-2)/4)*e*dy

	set pin = ix*n/2+iy+1

	table
	    { ix, dy }
	    { 0, -1 }
	    { 1, 1 }

	loop iy = 0, n/2-1

	__0: vec @(x, y)
	__1: vec .(px/2, py/2)
	__2: vec __0(-px/2, -py/2)
	pad "$pin" . __1
}

frame outline_side {
	loop if = 1, side

	__0: vec @((ox+w)/2, (oy+w)/2)
	__1: vec @(-(ox+w)/2, (oy+w)/2)
	__2: vec @(-(ox+w)/2, -(oy+w)/2)
	line __1 . w
	__3: vec @((ox+w)/2, -(oy+w)/2)
	line __0 . w
}

frame outline {
	set r = 0.1mm

	__0: vec @(ox/2, oy/2)
	__4: vec .(w/2, w/2)
	__1: vec @(-ox/2, -oy/2)
	__5: vec .(-w/2, -w/2)
	__2: vec @(-ox/2+r-w/2, oy/2+r+w*1.5)
	__3: vec .(0mm, r)
	circ __2 . w
	__6: vec @(ox/2, -oy/2)
	__8: vec .(w/2, -w/2)
	line __5 . w
	__7: vec @(-ox/2, oy/2)
	__9: vec .(-w/2, w/2)
	line . __4 w
	frame outline_side @
}

package "SMD-DIL-$name"
unit mm

table
    { name, alias, n, side, ox, oy, e, px, py, gx }
    { "TMD2671", "", 8, 1, 2.36mm, 3.94mm, py+0.25mm, 0.6mm, 0.72mm, 0.8mm }
    { "6-0.35", "DSF", 6, 0, 1mm, 1mm+0.1mm, 0.35mm, 0.53mm, 0.2mm, 0.15mm }
    { "8-0.35", "DQE", 8, 0, 1mm, 1.4mm+0.1mm, 0.35mm, 0.53mm, 0.2mm, 0.14mm }
    { "6-0.5", "SOT886", 6, 0, 1mm, 1.5mm+0.1mm, 0.5mm, 0.425mm, 0.37mm, 0.675mm-px }

set w = 5mil

frame pads @
frame outline @
measy outline.__1 >> outline.__0 1mm
measx outline.__1 >> outline.__0 -1mm
measx pads.__2 -> pads.__1 -0.8mm
measx pads.__1 -> pads.__2 -py-0.8mm
measy pads.__2 -> pads.__1 0.8mm
measy pads.__0 -> pads.__0 -ox
measy pads.__1 -> pads.__2 px+0.8mm
measx pads.__0 -> pads.__0 oy
